home *** CD-ROM | disk | FTP | other *** search
/ FM Towns: Software Contest 3 / FM Towns Software Contest 3.iso / exp / video_t / no1 / c_sorse / box.c next >
C/C++ Source or Header  |  1994-01-07  |  13KB  |  549 lines

  1. #include <stdio.h>
  2. #include <stdlib.h>
  3. #include <winb.h>
  4. #include <te.h>
  5. #include <fntb.h>
  6. #include <gui.h>
  7.  
  8. extern int    Dialog_box ;
  9. extern int    Message_box ;
  10. extern int    TIcon_box[4] ;
  11. extern int    box_func() ;
  12. extern int    Message_vox1 ;
  13. extern int    _001Message_vox1 ;
  14. extern int    _002Message_vox1 ;
  15. extern int    _003Message_vox1 ;
  16. extern int    TIcon_boxpaint ;
  17. extern int    _004Message_vox1 ;
  18. extern int    _005Message_vox1 ;
  19. extern int    NumBox_boxpen ;
  20. extern int    _006Message_vox1 ;
  21. extern int    NumBox_boxx1 ;
  22. extern int    _007Message_vox1 ;
  23. extern int    NumBox_boxy1 ;
  24. extern int    _008Message_vox1 ;
  25. extern int    NumBox_boxx2 ;
  26. extern int    _009Message_vox1 ;
  27. extern int    NumBox_boxy2 ;
  28. extern int    DButton_box ;
  29. extern int    box_on() ;
  30. extern int    _001DButton_box ;
  31. extern int    box_off() ;
  32. extern int    _002DButton_box ;
  33. extern int    box_kaku() ;
  34. extern int    _010Message_vox1 ;
  35. extern int    _011Message_vox1 ;
  36. extern int    _012Message_vox1 ;
  37. extern int    _003DButton_box ;
  38. extern int    box_set() ;
  39. extern int    _013Message_vox1 ;
  40.  
  41. #define ALIGN    4
  42. #define OFFSET(type) (sizeof(MMIPACKET) + (sizeof(type)+ALIGN-1)/ALIGN*ALIGN)
  43.  
  44. /*    MMI_init 用データ    */
  45.  
  46. /*    ヘッダ    */
  47.  
  48. MMIINIT    initDataBOX = { "MmiInit",  30, 0 } ;
  49.  
  50. /* Dialog_box */
  51.  
  52. static MMIPACKET d001 = {    &Dialog_box,
  53.                             NULL,
  54.                             &MJ_DIALOGL40,
  55.                             OFFSET(DIALOGL40),
  56.                             0
  57.                         } ;
  58. static DIALOGL40    d001d = {    MS_BTLEFTL40 | MS_EVMOSONL40,
  59.                               23,  25, 426, 346, 0, 7, 0,
  60.                             MS_SRECTL40 | MS_UFRAMEL40 | MS_FRAMEL40,
  61.                             NULL,   0,   0
  62.                         } ;
  63.  
  64. /* Message_box */
  65.  
  66. static MMIPACKET d002 = {    &Message_box,
  67.                             &Dialog_box,
  68.                             &MJ_MSGL40,
  69.                             OFFSET(MSGL40),
  70.                             0
  71.                         } ;
  72. static MSGL40    d002d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  73.                               31,  32, 419,  55, 0,15,12,
  74.                             MS_NONEL40,
  75.                             "四角形の描画",
  76.                                2,  16,  16,
  77.                             MS_NONEL40,
  78.                               16,   0
  79.                         } ;
  80.  
  81. /* TIcon_box[0] */
  82.  
  83. static MMIPACKET d003 = {    &TIcon_box[0],
  84.                             &Dialog_box,
  85.                             &MJ_TICONL40,
  86.                             OFFSET(TICONL40),
  87.                             0
  88.                         } ;
  89. static TICONL40    d003d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40 | MS_LEFTL40,
  90.                               34,  66,  51,  85, 0, 7, 0,
  91.                             MS_UFRAMEL40 | MS_FRAMEL40,
  92.                             box_func,
  93.                             0x0000, 259, 260
  94.                         } ;
  95.  
  96. /* Message_vox1 */
  97.  
  98. static MMIPACKET d004 = {    &Message_vox1,
  99.                             &Dialog_box,
  100.                             &MJ_MSGL40,
  101.                             OFFSET(MSGL40),
  102.                             0
  103.                         } ;
  104. static MSGL40    d004d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  105.                               55,  64, 214,  87, 0,15, 0,
  106.                             MS_NONEL40,
  107.                             "320*240の32000色画面",
  108.                                2,  16,  16,
  109.                             MS_NONEL40,
  110.                                0,   0
  111.                         } ;
  112.  
  113. /* TIcon_box[1] */
  114.  
  115. static MMIPACKET d005 = {    &TIcon_box[1],
  116.                             &Dialog_box,
  117.                             &MJ_TICONL40,
  118.                             OFFSET(TICONL40),
  119.                             0
  120.                         } ;
  121. static TICONL40    d005d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40 | MS_LEFTL40,
  122.                              232,  66, 249,  85, 0, 7, 0,
  123.                             MS_UFRAMEL40 | MS_FRAMEL40,
  124.                             box_func,
  125.                             0x0000, 259, 260
  126.                         } ;
  127.  
  128. /* _001Message_vox1 */
  129.  
  130. static MMIPACKET d006 = {    &_001Message_vox1,
  131.                             &Dialog_box,
  132.                             &MJ_MSGL40,
  133.                             OFFSET(MSGL40),
  134.                             0
  135.                         } ;
  136. static MSGL40    d006d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  137.                              253,  65, 412,  88, 0,15, 0,
  138.                             MS_NONEL40,
  139.                             "512*480の32000色画面",
  140.                                2,  16,  16,
  141.                             MS_NONEL40,
  142.                                0,   0
  143.                         } ;
  144.  
  145. /* TIcon_box[2] */
  146.  
  147. static MMIPACKET d007 = {    &TIcon_box[2],
  148.                             &Dialog_box,
  149.                             &MJ_TICONL40,
  150.                             OFFSET(TICONL40),
  151.                             0
  152.                         } ;
  153. static TICONL40    d007d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40 | MS_LEFTL40,
  154.                               34,  98,  51, 117, 0, 7, 0,
  155.                             MS_UFRAMEL40 | MS_FRAMEL40,
  156.                             box_func,
  157.                             0x0000, 259, 260
  158.                         } ;
  159.  
  160. /* TIcon_box[3] */
  161.  
  162. static MMIPACKET d008 = {    &TIcon_box[3],
  163.                             &Dialog_box,
  164.                             &MJ_TICONL40,
  165.                             OFFSET(TICONL40),
  166.                             0
  167.                         } ;
  168. static TICONL40    d008d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40 | MS_LEFTL40,
  169.                              233,  98, 250, 117, 0, 7, 0,
  170.                             MS_UFRAMEL40 | MS_FRAMEL40,
  171.                             box_func,
  172.                             0x0000, 259, 260
  173.                         } ;
  174.  
  175. /* _002Message_vox1 */
  176.  
  177. static MMIPACKET d009 = {    &_002Message_vox1,
  178.                             &Dialog_box,
  179.                             &MJ_MSGL40,
  180.                             OFFSET(MSGL40),
  181.                             0
  182.                         } ;
  183. static MSGL40    d009d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  184.                               55,  96, 196, 119, 0,15, 0,
  185.                             MS_NONEL40,
  186.                             "720*480の256色画面",
  187.                                2,  16,  16,
  188.                             MS_NONEL40,
  189.                                0,   0
  190.                         } ;
  191.  
  192. /* _003Message_vox1 */
  193.  
  194. static MMIPACKET d010 = {    &_003Message_vox1,
  195.                             &Dialog_box,
  196.                             &MJ_MSGL40,
  197.                             OFFSET(MSGL40),
  198.                             0
  199.                         } ;
  200. static MSGL40    d010d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  201.                              255,  96, 400, 119, 0,15, 0,
  202.                             MS_NONEL40,
  203.                             "640*480の16色画面",
  204.                                2,  16,  16,
  205.                             MS_NONEL40,
  206.                                1,   0
  207.                         } ;
  208.  
  209. /* TIcon_boxpaint */
  210.  
  211. static MMIPACKET d011 = {    &TIcon_boxpaint,
  212.                             &Dialog_box,
  213.                             &MJ_TICONL40,
  214.                             OFFSET(TICONL40),
  215.                             0
  216.                         } ;
  217. static TICONL40    d011d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40 | MS_LEFTL40,
  218.                              265, 145, 282, 164, 0, 7,15,
  219.                             MS_UFRAMEL40 | MS_FRAMEL40,
  220.                             0,
  221.                             0x0000, 259, 260
  222.                         } ;
  223.  
  224. /* _004Message_vox1 */
  225.  
  226. static MMIPACKET d012 = {    &_004Message_vox1,
  227.                             &Dialog_box,
  228.                             &MJ_MSGL40,
  229.                             OFFSET(MSGL40),
  230.                             0
  231.                         } ;
  232. static MSGL40    d012d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  233.                               44, 143, 135, 166, 0,15, 0,
  234.                             MS_NONEL40,
  235.                             "ペンの太さ",
  236.                                2,  16,  16,
  237.                             MS_NONEL40,
  238.                                0,   0
  239.                         } ;
  240.  
  241. /* _005Message_vox1 */
  242.  
  243. static MMIPACKET d013 = {    &_005Message_vox1,
  244.                             &Dialog_box,
  245.                             &MJ_MSGL40,
  246.                             OFFSET(MSGL40),
  247.                             0
  248.                         } ;
  249. static MSGL40    d013d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  250.                              280, 143, 395, 166, 0,15,15,
  251.                             MS_NONEL40,
  252.                             "枠の中を塗る",
  253.                                2,  16,  16,
  254.                             MS_NONEL40,
  255.                                0,   0
  256.                         } ;
  257.  
  258. /* NumBox_boxpen */
  259.  
  260. static MMIPACKET d014 = {    &NumBox_boxpen,
  261.                             &Dialog_box,
  262.                             &MJ_NUMBOXL40,
  263.                             OFFSET(NUMBOXL40),
  264.                             0
  265.                         } ;
  266. static NUMBOXL40    d014d =     {    MS_BTLEFTL40 | MS_REPEATL40 | MS_EVMOSONL40 | MS_EVKEYONL40 | MS_RIGHTL40,
  267.                              136, 145, 180, 165, 0, 7, 0,
  268.                             MS_PANELL40 | MS_DFRAMEL40 | MS_FRAMEL40,
  269.                             0,
  270.                                1,  12,  12,
  271.                             MS_NONEL40,
  272.                                0,   0,
  273.                                1,   1,  32,   1,   0,
  274.                              263, 264
  275.                         } ;
  276.  
  277. /* _006Message_vox1 */
  278.  
  279. static MMIPACKET d015 = {    &_006Message_vox1,
  280.                             &Dialog_box,
  281.                             &MJ_MSGL40,
  282.                             OFFSET(MSGL40),
  283.                             0
  284.                         } ;
  285. static MSGL40    d015d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  286.                               47, 190, 148, 213, 0,15, 0,
  287.                             MS_NONEL40,
  288.                             "左上のX座標",
  289.                                2,  16,  16,
  290.                             MS_NONEL40,
  291.                                0,   0
  292.                         } ;
  293.  
  294. /* NumBox_boxx1 */
  295.  
  296. static MMIPACKET d016 = {    &NumBox_boxx1,
  297.                             &Dialog_box,
  298.                             &MJ_NUMBOXL40,
  299.                             OFFSET(NUMBOXL40),
  300.                             0
  301.                         } ;
  302. static NUMBOXL40    d016d =     {    MS_BTLEFTL40 | MS_REPEATL40 | MS_EVMOSONL40 | MS_EVKEYONL40 | MS_RIGHTL40,
  303.                              154, 191, 198, 211, 0, 7, 0,
  304.                             MS_PANELL40 | MS_DFRAMEL40 | MS_FRAMEL40,
  305.                             0,
  306.                                1,  12,  12,
  307.                             MS_NONEL40,
  308.                                0,   0,
  309.                                0,   0, 720,   1,   0,
  310.                              263, 264
  311.                         } ;
  312.  
  313. /* _007Message_vox1 */
  314.  
  315. static MMIPACKET d017 = {    &_007Message_vox1,
  316.                             &Dialog_box,
  317.                             &MJ_MSGL40,
  318.                             OFFSET(MSGL40),
  319.                             0
  320.                         } ;
  321. static MSGL40    d017d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  322.                              236, 190, 337, 213, 0,15, 0,
  323.                             MS_NONEL40,
  324.                             "左上のY座標",
  325.                                2,  16,  16,
  326.                             MS_NONEL40,
  327.                                0,   0
  328.                         } ;
  329.  
  330. /* NumBox_boxy1 */
  331.  
  332. static MMIPACKET d018 = {    &NumBox_boxy1,
  333.                             &Dialog_box,
  334.                             &MJ_NUMBOXL40,
  335.                             OFFSET(NUMBOXL40),
  336.                             0
  337.                         } ;
  338. static NUMBOXL40    d018d =     {    MS_BTLEFTL40 | MS_REPEATL40 | MS_EVMOSONL40 | MS_EVKEYONL40 | MS_RIGHTL40,
  339.                              347, 191, 391, 211, 0, 7, 0,
  340.                             MS_PANELL40 | MS_DFRAMEL40 | MS_FRAMEL40,
  341.                             0,
  342.                                1,  12,  12,
  343.                             MS_NONEL40,
  344.                                0,   0,
  345.                                0,   0, 480,   1,   0,
  346.                              263, 264
  347.                         } ;
  348.  
  349. /* _008Message_vox1 */
  350.  
  351. static MMIPACKET d019 = {    &_008Message_vox1,
  352.                             &Dialog_box,
  353.                             &MJ_MSGL40,
  354.                             OFFSET(MSGL40),
  355.                             0
  356.                         } ;
  357. static MSGL40    d019d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  358.                               47, 229, 148, 252, 0,15, 0,
  359.                             MS_NONEL40,
  360.                             "右下のX座標",
  361.                                2,  16,  16,
  362.                             MS_NONEL40,
  363.                                0,   0
  364.                         } ;
  365.  
  366. /* NumBox_boxx2 */
  367.  
  368. static MMIPACKET d020 = {    &NumBox_boxx2,
  369.                             &Dialog_box,
  370.                             &MJ_NUMBOXL40,
  371.                             OFFSET(NUMBOXL40),
  372.                             0
  373.                         } ;
  374. static NUMBOXL40    d020d =     {    MS_BTLEFTL40 | MS_REPEATL40 | MS_EVMOSONL40 | MS_EVKEYONL40 | MS_RIGHTL40,
  375.                              154, 231, 198, 251, 0, 7, 0,
  376.                             MS_PANELL40 | MS_DFRAMEL40 | MS_FRAMEL40,
  377.                             0,
  378.                                1,  12,  12,
  379.                             MS_NONEL40,
  380.                                0,   0,
  381.                                0,   0, 720,   1,   0,
  382.                              263, 264
  383.                         } ;
  384.  
  385. /* _009Message_vox1 */
  386.  
  387. static MMIPACKET d021 = {    &_009Message_vox1,
  388.                             &Dialog_box,
  389.                             &MJ_MSGL40,
  390.                             OFFSET(MSGL40),
  391.                             0
  392.                         } ;
  393. static MSGL40    d021d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  394.                              236, 230, 337, 253, 0,15, 0,
  395.                             MS_NONEL40,
  396.                             "右下のY座標",
  397.                                2,  16,  16,
  398.                             MS_NONEL40,
  399.                                0,   0
  400.                         } ;
  401.  
  402. /* NumBox_boxy2 */
  403.  
  404. static MMIPACKET d022 = {    &NumBox_boxy2,
  405.                             &Dialog_box,
  406.                             &MJ_NUMBOXL40,
  407.                             OFFSET(NUMBOXL40),
  408.                             0
  409.                         } ;
  410. static NUMBOXL40    d022d =     {    MS_BTLEFTL40 | MS_REPEATL40 | MS_EVMOSONL40 | MS_EVKEYONL40 | MS_RIGHTL40,
  411.                              347, 231, 391, 251, 0, 7, 0,
  412.                             MS_PANELL40 | MS_DFRAMEL40 | MS_FRAMEL40,
  413.                             0,
  414.                                1,  12,  12,
  415.                             MS_NONEL40,
  416.                                0,   0,
  417.                                0,   0, 480,   1,   0,
  418.                              263, 264
  419.                         } ;
  420.  
  421. /* DButton_box */
  422.  
  423. static MMIPACKET d023 = {    &DButton_box,
  424.                             &Dialog_box,
  425.                             &MJ_DBUTTONL40,
  426.                             OFFSET(DBUTTONL40),
  427.                             0
  428.                         } ;
  429. static DBUTTONL40    d023d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40,
  430.                               59, 305, 138, 330, 0, 7, 0,
  431.                             MS_UFRAMEL40 | MS_FRAMEL40 | MS_DEFAULTL40,
  432.                             box_on,
  433.                             0x0000
  434.                         } ;
  435.  
  436. /* _001DButton_box */
  437.  
  438. static MMIPACKET d024 = {    &_001DButton_box,
  439.                             &Dialog_box,
  440.                             &MJ_DBUTTONL40,
  441.                             OFFSET(DBUTTONL40),
  442.                             0
  443.                         } ;
  444. static DBUTTONL40    d024d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40,
  445.                              318, 305, 397, 330, 0, 7, 0,
  446.                             MS_UFRAMEL40 | MS_FRAMEL40,
  447.                             box_off,
  448.                             0x0000
  449.                         } ;
  450.  
  451. /* _002DButton_box */
  452.  
  453. static MMIPACKET d025 = {    &_002DButton_box,
  454.                             &Dialog_box,
  455.                             &MJ_DBUTTONL40,
  456.                             OFFSET(DBUTTONL40),
  457.                             0
  458.                         } ;
  459. static DBUTTONL40    d025d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40,
  460.                              165, 305, 291, 330, 0, 7, 0,
  461.                             MS_UFRAMEL40 | MS_FRAMEL40,
  462.                             box_kaku,
  463.                             0x0000
  464.                         } ;
  465.  
  466. /* _010Message_vox1 */
  467.  
  468. static MMIPACKET d026 = {    &_010Message_vox1,
  469.                             &Dialog_box,
  470.                             &MJ_MSGL40,
  471.                             OFFSET(MSGL40),
  472.                             0
  473.                         } ;
  474. static MSGL40    d026d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  475.                               60, 306, 139, 329, 0,15,15,
  476.                             MS_NONEL40,
  477.                             "確定",
  478.                                2,  16,  16,
  479.                             MS_NONEL40,
  480.                               16,   0
  481.                         } ;
  482.  
  483. /* _011Message_vox1 */
  484.  
  485. static MMIPACKET d027 = {    &_011Message_vox1,
  486.                             &Dialog_box,
  487.                             &MJ_MSGL40,
  488.                             OFFSET(MSGL40),
  489.                             0
  490.                         } ;
  491. static MSGL40    d027d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  492.                              166, 306, 290, 329, 0,15,15,
  493.                             MS_NONEL40,
  494.                             "四角形確認",
  495.                                2,  16,  16,
  496.                             MS_NONEL40,
  497.                                0,   0
  498.                         } ;
  499.  
  500. /* _012Message_vox1 */
  501.  
  502. static MMIPACKET d028 = {    &_012Message_vox1,
  503.                             &Dialog_box,
  504.                             &MJ_MSGL40,
  505.                             OFFSET(MSGL40),
  506.                             0
  507.                         } ;
  508. static MSGL40    d028d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  509.                              319, 306, 398, 329, 0,15,15,
  510.                             MS_NONEL40,
  511.                             "取消",
  512.                                2,  16,  16,
  513.                             MS_NONEL40,
  514.                               16,   0
  515.                         } ;
  516.  
  517. /* _003DButton_box */
  518.  
  519. static MMIPACKET d029 = {    &_003DButton_box,
  520.                             &Dialog_box,
  521.                             &MJ_DBUTTONL40,
  522.                             OFFSET(DBUTTONL40),
  523.                             0
  524.                         } ;
  525. static DBUTTONL40    d029d = {    MS_BTLEFTL40 | MS_EVKEYONL40 | MS_EVMOSOFFL40,
  526.                              149, 269, 305, 292, 0, 7, 0,
  527.                             MS_UFRAMEL40 | MS_FRAMEL40,
  528.                             box_set,
  529.                             0x0000
  530.                         } ;
  531.  
  532. /* _013Message_vox1 */
  533.  
  534. static MMIPACKET d030 = {    &_013Message_vox1,
  535.                             &Dialog_box,
  536.                             &MJ_MSGL40,
  537.                             OFFSET(MSGL40),
  538.                             0
  539.                         } ;
  540. static MSGL40    d030d =     {    MS_CENTERL40 | MS_DSPONLYL40,
  541.                              150, 271, 304, 291, 0,15,15,
  542.                             MS_NONEL40,
  543.                             "座標位置指定",
  544.                                2,  16,  16,
  545.                             MS_NONEL40,
  546.                                2,   0
  547.                         } ;
  548.  
  549.